package com.zhl.framework.core.common.jdk;

import com.zhl.framework.core.proxy.ProxyFactory;

import java.lang.reflect.Proxy;

/**
 * @Author: ZhangLu In DLUT
 * @since: 1.0.0
 * @Description:
 */
public class JDKProxyFactory implements ProxyFactory {
    @Override
    public <T> T getProxy(Class clazz) throws Throwable {

        return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz}, new JDKClientInvocationHandler(clazz));
    }
}
